3.1.79 \(\int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\) [79]

Optimal. Leaf size=116 \[ -\frac {x}{16 a^4}-\frac {i}{8 d (a+i a \tan (c+d x))^4}+\frac {i}{4 a d (a+i a \tan (c+d x))^3}-\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )} \]

[Out]

-1/16*x/a^4-1/8*I/d/(a+I*a*tan(d*x+c))^4+1/4*I/a/d/(a+I*a*tan(d*x+c))^3-1/16*I/d/(a^2+I*a^2*tan(d*x+c))^2-1/16
*I/d/(a^4+I*a^4*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3621, 3607, 3560, 8} \begin {gather*} -\frac {i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac {x}{16 a^4}-\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac {i}{4 a d (a+i a \tan (c+d x))^3}-\frac {i}{8 d (a+i a \tan (c+d x))^4} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

-1/16*x/a^4 - (I/8)/(d*(a + I*a*Tan[c + d*x])^4) + (I/4)/(a*d*(a + I*a*Tan[c + d*x])^3) - (I/16)/(d*(a^2 + I*a
^2*Tan[c + d*x])^2) - (I/16)/(d*(a^4 + I*a^4*Tan[c + d*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3560

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a + b*Tan[c + d*x])^n/(2*b*d*n)), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 3607

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(
b*c - a*d))*((a + b*Tan[e + f*x])^m/(2*a*f*m)), x] + Dist[(b*c + a*d)/(2*a*b), Int[(a + b*Tan[e + f*x])^(m + 1
), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0]

Rule 3621

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(
-b)*(a*c + b*d)^2*((a + b*Tan[e + f*x])^m/(2*a^3*f*m)), x] + Dist[1/(2*a^2), Int[(a + b*Tan[e + f*x])^(m + 1)*
Simp[a*c^2 - 2*b*c*d + a*d^2 - 2*b*d^2*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a
*d, 0] && LeQ[m, -1] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx &=-\frac {i}{8 d (a+i a \tan (c+d x))^4}+\frac {\int \frac {a-2 i a \tan (c+d x)}{(a+i a \tan (c+d x))^3} \, dx}{2 a^2}\\ &=-\frac {i}{8 d (a+i a \tan (c+d x))^4}+\frac {i}{4 a d (a+i a \tan (c+d x))^3}-\frac {\int \frac {1}{(a+i a \tan (c+d x))^2} \, dx}{4 a^2}\\ &=-\frac {i}{8 d (a+i a \tan (c+d x))^4}+\frac {i}{4 a d (a+i a \tan (c+d x))^3}-\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {\int \frac {1}{a+i a \tan (c+d x)} \, dx}{8 a^3}\\ &=-\frac {i}{8 d (a+i a \tan (c+d x))^4}+\frac {i}{4 a d (a+i a \tan (c+d x))^3}-\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac {\int 1 \, dx}{16 a^4}\\ &=-\frac {x}{16 a^4}-\frac {i}{8 d (a+i a \tan (c+d x))^4}+\frac {i}{4 a d (a+i a \tan (c+d x))^3}-\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.37, size = 69, normalized size = 0.59 \begin {gather*} -\frac {(\cos (4 (c+d x))-i \sin (4 (c+d x))) (-4 i+(i+8 d x) \cos (4 (c+d x))+(1+8 i d x) \sin (4 (c+d x)))}{128 a^4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

-1/128*((Cos[4*(c + d*x)] - I*Sin[4*(c + d*x)])*(-4*I + (I + 8*d*x)*Cos[4*(c + d*x)] + (1 + (8*I)*d*x)*Sin[4*(
c + d*x)]))/(a^4*d)

________________________________________________________________________________________

Maple [A]
time = 0.15, size = 89, normalized size = 0.77

method result size
risch \(-\frac {x}{16 a^{4}}+\frac {i {\mathrm e}^{-4 i \left (d x +c \right )}}{32 a^{4} d}-\frac {i {\mathrm e}^{-8 i \left (d x +c \right )}}{128 a^{4} d}\) \(44\)
derivativedivides \(\frac {\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{4}}+\frac {i \ln \left (\tan \left (d x +c \right )-i\right )}{32}-\frac {1}{4 \left (\tan \left (d x +c \right )-i\right )^{3}}-\frac {1}{16 \left (\tan \left (d x +c \right )-i\right )}-\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{32}}{d \,a^{4}}\) \(89\)
default \(\frac {\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {i}{8 \left (\tan \left (d x +c \right )-i\right )^{4}}+\frac {i \ln \left (\tan \left (d x +c \right )-i\right )}{32}-\frac {1}{4 \left (\tan \left (d x +c \right )-i\right )^{3}}-\frac {1}{16 \left (\tan \left (d x +c \right )-i\right )}-\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{32}}{d \,a^{4}}\) \(89\)
norman \(\frac {-\frac {i \left (\tan ^{4}\left (d x +c \right )\right )}{d a}-\frac {x}{16 a}-\frac {9 \left (\tan ^{5}\left (d x +c \right )\right )}{16 d a}-\frac {\tan ^{7}\left (d x +c \right )}{16 d a}-\frac {x \left (\tan ^{2}\left (d x +c \right )\right )}{4 a}-\frac {3 x \left (\tan ^{4}\left (d x +c \right )\right )}{8 a}-\frac {x \left (\tan ^{6}\left (d x +c \right )\right )}{4 a}-\frac {x \left (\tan ^{8}\left (d x +c \right )\right )}{16 a}+\frac {\tan \left (d x +c \right )}{16 d a}+\frac {9 \left (\tan ^{3}\left (d x +c \right )\right )}{16 d a}}{\left (1+\tan ^{2}\left (d x +c \right )\right )^{4} a^{3}}\) \(159\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/d/a^4*(1/16*I/(tan(d*x+c)-I)^2-1/8*I/(tan(d*x+c)-I)^4+1/32*I*ln(tan(d*x+c)-I)-1/4/(tan(d*x+c)-I)^3-1/16/(tan
(d*x+c)-I)-1/32*I*ln(tan(d*x+c)+I))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 43, normalized size = 0.37 \begin {gather*} -\frac {{\left (8 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 4 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + i\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{128 \, a^{4} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

-1/128*(8*d*x*e^(8*I*d*x + 8*I*c) - 4*I*e^(4*I*d*x + 4*I*c) + I)*e^(-8*I*d*x - 8*I*c)/(a^4*d)

________________________________________________________________________________________

Sympy [A]
time = 0.20, size = 117, normalized size = 1.01 \begin {gather*} \begin {cases} \frac {\left (128 i a^{4} d e^{8 i c} e^{- 4 i d x} - 32 i a^{4} d e^{4 i c} e^{- 8 i d x}\right ) e^{- 12 i c}}{4096 a^{8} d^{2}} & \text {for}\: a^{8} d^{2} e^{12 i c} \neq 0 \\x \left (\frac {\left (- e^{8 i c} + 2 e^{4 i c} - 1\right ) e^{- 8 i c}}{16 a^{4}} + \frac {1}{16 a^{4}}\right ) & \text {otherwise} \end {cases} - \frac {x}{16 a^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise(((128*I*a**4*d*exp(8*I*c)*exp(-4*I*d*x) - 32*I*a**4*d*exp(4*I*c)*exp(-8*I*d*x))*exp(-12*I*c)/(4096*a
**8*d**2), Ne(a**8*d**2*exp(12*I*c), 0)), (x*((-exp(8*I*c) + 2*exp(4*I*c) - 1)*exp(-8*I*c)/(16*a**4) + 1/(16*a
**4)), True)) - x/(16*a**4)

________________________________________________________________________________________

Giac [A]
time = 1.10, size = 87, normalized size = 0.75 \begin {gather*} -\frac {\frac {2 i \, \log \left (-i \, \tan \left (2 \, d x + 2 \, c\right ) + 1\right )}{a^{4}} - \frac {2 i \, \log \left (-i \, \tan \left (2 \, d x + 2 \, c\right ) - 1\right )}{a^{4}} + \frac {3 i \, \tan \left (2 \, d x + 2 \, c\right )^{2} - 6 \, \tan \left (2 \, d x + 2 \, c\right ) + 5 i}{a^{4} {\left (\tan \left (2 \, d x + 2 \, c\right ) - i\right )}^{2}}}{128 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-1/128*(2*I*log(-I*tan(2*d*x + 2*c) + 1)/a^4 - 2*I*log(-I*tan(2*d*x + 2*c) - 1)/a^4 + (3*I*tan(2*d*x + 2*c)^2
- 6*tan(2*d*x + 2*c) + 5*I)/(a^4*(tan(2*d*x + 2*c) - I)^2))/d

________________________________________________________________________________________

Mupad [B]
time = 3.90, size = 92, normalized size = 0.79 \begin {gather*} -\frac {x}{16\,a^4}+\frac {\frac {\mathrm {tan}\left (c+d\,x\right )}{16\,a^4}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{16\,a^4}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{4\,a^4}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4-{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}-6\,{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,4{}\mathrm {i}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^2/(a + a*tan(c + d*x)*1i)^4,x)

[Out]

(tan(c + d*x)/(16*a^4) + (tan(c + d*x)^2*1i)/(4*a^4) - tan(c + d*x)^3/(16*a^4))/(d*(tan(c + d*x)*4i - 6*tan(c
+ d*x)^2 - tan(c + d*x)^3*4i + tan(c + d*x)^4 + 1)) - x/(16*a^4)

________________________________________________________________________________________